<template>
    <div class="table">
        <el-table :data="data" border stripe>
            <el-table-column :prop="item.name" :type="item.type" :label="item.label" v-for="item, index in clos"
                :key="index">
                <template v-slot="{ row, index }" v-if="item.slot">
                    <slot :row="row" :index="index" :name="item.slot"></slot>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="current_page"
            :page-sizes="page_sizes" :page-size="page_size" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
    </div>
</template>
<script>
import { number } from 'echarts'
export default {
    props: {
        clos: {
            required: true,
            type: Array,
            default: () => []
        },
        data: {
            required: true,
            type: Array,
            default: () => [],
        },
        current_page: {
            required: true,
            type: Number
        },
        page_sizes: {
            required: true,
            type: Array,
            default: () => []
        },
        page_size: {
            type: Number
        },
        total: {
            type: Number
        },
    },
    methods: {
        handleSizeChange(val) {
            this.$emit('handleSizeChange', val)
        },
        handleCurrentChange(val) {
            this.$emit('handleCurrentChange', val)
        },
    },
    data() {
        return {

        }
    },
}
</script>
<style lang="scss" scoped></style>